# Maintainer: Ray Donnelly <mingw.android@gmail.com>
# Based on Arch Linux package maintained by : Balló György <ballogyor+arch at gmail dot com>

_realname=d-feet
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=0.3.10
pkgrel=1
pkgdesc="D-Bus debugger for GNOME (mingw-w64)"
arch=('any')
url="https://wiki.gnome.org/Apps/DFeet"
license=('GPL')
depends=("${MINGW_PACKAGE_PREFIX}-gtk3"
         "${MINGW_PACKAGE_PREFIX}-python3-gobject"
         "${MINGW_PACKAGE_PREFIX}-hicolor-icon-theme")
makedepends=("${MINGW_PACKAGE_PREFIX}-python3-setuptools" "intltool" "itstool")
install=d-feet-${CARCH}.install
source=(https://download.gnome.org/sources/${_realname}/${pkgver%.*}/${_realname}-${pkgver}.tar.xz
        localedir-fix.patch)
sha256sums=('88f0df5fcb862387ff3d1793873c5eb368c3e4db0bbd82ea65f748cbf70a6359'
            'fc75a1e0fafac35a0c94a6c0fff6d0a28c7d5d6ac80ad4ca89399945feafb6c7')

prepare() {
  cd "${srcdir}/${_realname}-${pkgver}"
  patch -p1 -i ${srcdir}/localedir-fix.patch
  autoreconf -fi
}

build() {
  [[ -d "${srcdir}/build-${CARCH}" ]] && rm -rf ${srcdir}/build-${CARCH}
  mkdir -p ${srcdir}/build-${CARCH}
  cd ${srcdir}/build-${CARCH}

  PYTHON=${MINGW_PREFIX}/bin/python3 \
  ../${_realname}-${pkgver}/configure \
    --prefix=${MINGW_PREFIX} \
    --sysconfdir="${pkgdir}${MINGW_PREFIX}/etc" \
    --localstatedir="${pkgdir}${MINGW_PREFIX}/var" \
    --disable-tests

  make
}

check() {
  cd build-${CARCH}
  #make check
}

package() {
  cd "${srcdir}/build-${CARCH}"
  make DESTDIR="${pkgdir}" install
}
